<!--标签添加页-->
<extend file='resource/view/master'/>
<block name="content">
    <ol class="breadcrumb" style="background-color: #f9f9f9;padding:8px 0;margin-bottom:10px;">
        <li>
            <a href=""><i class="fa fa-cogs"></i>
                类型管理</a>
        </li>
        <li class="active">
            <a href="">修改属性</a>
        </li>

    </ol>
    <ul class="nav nav-tabs" role="tablist">
        <li><a href="{{u('Typeattr.index',['tid'=>$olddata['tid']])}}">属性管理</a></li>
        <li class="active"><a href="">修改属性</a></li>
    </ul>
    <form class="form-horizontal" id="form" action="" method="post" onsubmit="return edit()" >
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">属性管理</h3>
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label for="" class="col-sm-2 control-label">属性名称</label>
                    <div class="col-sm-9">
                        <input type="text" name="taname" value="{{$olddata['taname']}}"  class="form-control" placeholder="请填写属性名称">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">属性类别</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                            <input type="radio" value="1" name="class"  <if value="$olddata['class']==1" >checked="checked"</if> ><i></i> 属性
                        </label>
                        <label class="radio-inline">
                            <input type="radio" value="2" name="class" <if value="$olddata['class']==2" >checked="checked"</if> ><i></i> 规格
                        </label>
                        <input type="hidden" name="tid" value="{{$olddata['tid']}}">
                        <input type="hidden" name="taid" value="{{$olddata['taid']}}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">属性值</label>
                    <div class="col-sm-9">
                        <textarea  class="form-control" name="tavalue" placeholder="添加多个属性值用 | 隔开">{{$olddata['tavalue']}}</textarea>
                    </div>
                </div>

            </div>
        </div>
        <button class="btn btn-primary" type="submit">确定修改</button>
    </form>

</block>
<script>
    function edit()
    {
        var data = $('#form').serialize();
        $.post("{{u('edit')}}",data,function(res){
            if(res.valid)
            {
                util.message(res.message,{{u('index')}},'success');
            }else{
                util.message(res.message,'back','error');
            }

        },"json")
        return false;
    }
</script>
